package org.example.Servicelmpl;

import org.example.BusinessExcption;
import org.example.Service.ManufactureService;
import org.example.domain.Manufacture;
import org.example.mapper.ManufactureMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.SQLDataException;
import java.sql.SQLException;
import java.util.List;

@Service
public class ManufactureServicelmpl implements ManufactureService {

    @Autowired
    private ManufactureMapper manufactureMapper;
    @Override
    public List<Manufacture> queryAll() {
      List<Manufacture> list= manufactureMapper.queryAll();
        return list;
    }

    @Override
    public Manufacture queryById(Integer id) {
      Manufacture manufacture = manufactureMapper.queryById(id);
        return manufacture;
    }

    @Override
    public boolean add(Manufacture manufacture) {
     manufactureMapper.add(manufacture);
        return true;
    }

    @Override
    public boolean deleteById(Integer id) {
        manufactureMapper.deletebyId(id);
        return true;
    }

    @Override
    public boolean update(Manufacture manufacture) {
        manufactureMapper.updateManufacture(manufacture);
        return true;
    }



}
